<div id="map">
	<span class='title'>添加分类</span>
</div>
<div id="content">
<script type="text/javascript">
	var url="<?php echo $this->createUrl('category/addcate') ?>";
</script>





<?php $form=$this->beginWidget('CActiveForm', array(
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
    'htmlOptions'=>array('enctype'=>'multipart/form-data'),
	'enableAjaxValidation'=>false,
	'enableClientValidation'=>true,
	'clientOptions'=>array('validateOnSubmit'=>true)

)); 
?>
<table class="table table-striped table-bordered">
	<tr class='form-group'>
		<th width="20%">名称</th>
		<th>值</th>
	</tr>
	<tr>
		<td><?php echo $form->labelEx($category,'pid') ?></td>
		<td>
		<select name="Category[pid]">

		<?php if(is_array($arr)){ ?>

			<option value="<?php echo $arr['cid'] ?>"><?php echo $arr['cname'] ?></option>
	<?php 
}else{
		 ?>
			<option value="<?php echo $arr->cid; ?>"><?php echo $arr->cname; ?></option>


		 <?php } ?>


			<?php if(!empty($data)){ 
				foreach($data as $v){
					if(!is_array($arr)){
						if($arr->cid==$v['cid']){
							continue;
				?>

			
			<?php }}?>
				<option value="<?php echo $v['cid'] ?>"><?php echo $v['html'].$v['cname']?></option>	
			<?php }} ?>



		</select>
		</td>
		<td><?php echo $form->error($category,'pid') ?></td>
	</tr>



	<tr>
		<td><?php echo $form->labelEx($category,'cname') ?></td>
		<td>
		<?php echo $form->textField($category,'cname') ?>
		</td>
		<td><?php echo $form->error($category,'cname') ?></td>
	</tr>
	<tr>
		<td><?php echo $form->labelEx($category,'title') ?></td>
		<td>
		<?php echo $form->textarea($category,'title',array('style'=>'resize:none')) ?>

		</td>
		<td><?php echo $form->error($category,'title') ?></td>
	</tr>
	<tr>
		<td><?php echo $form->labelEx($category,'keywords') ?></td>
		<td><?php echo $form->textarea($category,'keywords',array('style'=>'resize:none')) ?></td>
		<td><?php echo $form->error($category,'keywords') ?></td>
	</tr>
	<tr>
		<td><?php echo $form->labelEx($category,'description') ?></td>
		<td><?php echo $form->textarea($category,'description',array('style'=>'resize:none')) ?></td>
		<td><?php echo $form->error($category,'description') ?></td>
	</tr>
	<tr>
		<td><?php echo $form->labelEx($category,'sort') ?></td>
		<td><?php echo $form->textField($category,'sort') ?></td>
		<td><?php echo $form->error($category,'sort') ?></td>
	</tr>
	<tr>
		<td><?php echo $form->labelEx($category,'display') ?></td>
		<td>
		<input type="radio" name="Category[display]" value="1" checked="checked">显示
		<input type="radio" name="Category[display]" value="0">隐藏
		</td>
		<td><?php echo $form->error($category,'display') ?></td>
	</tr>
	<tr>
		<td colspan="2"><input type="submit" id="sub" value="提交" class="btn btn-primary btn-default"></td>
	</tr>


<?php $this->endWidget() ?>
</table>
</div>

</body>
</html>